package logic

import (
	"context"
	"meituan-waimai/pkg"

	"meituan-waimai/meituanrpc/internal/svc"
	"meituan-waimai/meituanrpc/meituanrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type SendSmsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewSendSmsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendSmsLogic {
	return &SendSmsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *SendSmsLogic) SendSms(in *meituanrpc.SendSmsRequest) (*meituanrpc.SendSmsResponse, error) {
	// todo: add your logic here and delete this line
	err := pkg.SendSms(in.Mobile)
	if err != nil {
		return nil, err
	}
	return &meituanrpc.SendSmsResponse{}, nil
}
